<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/mui.min.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/share.css">
    <script src="js/vue.js"></script>
    <script src='js/axios.js'></script>
    <title>分享软件</title>
</head>

<body>
    <header class="mui-bar mui-bar-nav head">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title nav-title">分享软件</h1>
    </header>
    <main>
        <div id="app">
           <div class="all" @longtap="long">
			   <a href="arr.val" download="arr.val" id="img"></a>
			   <img src="images/share_bj2.png" alt="">
			   <!-- 文字 -->
			   <div class="text">
				   <span class="text1">{{text1}}</span><br>
				   <span class="text2">{{text2}}</span>
			   </div>
			   <!-- 二维码 -->
			   <div class="erw">
				   <img :src="arr.val">
			   </div>
			   <!-- 底部文字 -->
			   <div class="bottext">长按保存二维码</div>
			 
		   </div>
        </div>
    </main>
    <footer>
    </footer>
    <script src="js/mui.min.js"></script>
    <script>
		mui.init({gestureConfig:{
			longtap:true 
		}})
        const API_PROXY = 'https://bird.ioliu.cn/v1/?url='
        new Vue({
            el: '#app',
            data: {
               arr : [],
			   text1 : '',
			   text2 : ''				  
            },
            created() {
                 this.getQrcode()
            },
            methods: {
				// 向后台发送请求
               getQrcode : function(){
                   axios.post(API_PROXY + 'mingpian.32one.top/Index/Member/share')
                       .then(res => {
                           console.log(res);
						   this.arr = res.data.data;
						   // 截取文字,放在两个div中
						   this.text1 = this.arr.code.substring(0,10);
						   this.text2 = this.arr.code.substring(10,17)
                       }, err => {
                           console.log(err);
                       })
               },
			   long(){
				   document.getElementById('img').click();
			   }
            }
        })
    </script>
</body>

</html>